import java.util.Scanner;

public class Day_13_2_跳石板 {
    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();
        int result = N;
        int count = 0;
        while(result != M) {
            for(int i = N/2; i > 0; i--) {
                for(int j = N/2; j < N; j++) {
                    if(i * j == N) {
                        result += j;
                        count ++;
                        N = result;
                    }
                }
            }
        }
        System.out.println(count);
    }
}
